package com.itzol.javablog.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itzol.javablog.entity.Post;
import com.itzol.javablog.mapper.Postmapper;
import com.itzol.javablog.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PostServiceimpl extends ServiceImpl<Postmapper,Post> implements PostService{
    @Autowired
    private PostService postService;
    @Override
    public boolean AddPost(Post post) {
       boolean r = postService.save(post);
        if (r) {
            return true;
        }else {
            return false;
        }
    }
    @Override
    public List<Post> GetPost(Integer page,Integer size){
        Page<Post> p = new Page<>(page,size);
        postService.page(p);
        return null;
    }
}
